﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;

namespace DataService
{
    // NOTE: If you change the interface name "IService1" here, you must also update the reference to "IService1" in App.config.
    [ServiceContract]
    public interface IService1
    {
        [OperationContract]
        string GetData(int value);

        [OperationContract]
        CompositeType GetDataUsingDataContract(CompositeType composite);

        // TODO: Add your service operations 

        [OperationContract]
        void DeleteAllTracks();
        
        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ArtistsDataTable GetArtists();

        [OperationContract]
        void UpdateArtists(DataEntityTier.OpenRecordsDataSet.ArtistsDataTable ArtistDataTable);

        [OperationContract]
        void UpdateProjects(DataEntityTier.OpenRecordsDataSet.ProjectsDataTable ProjectsDataTable);
         
        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ManagersDataTable GetManagers();

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TracksDataTable GetTracks();

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ProjectsDataTable GetProjects();

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ProjectsDataTable GetProjectsByProjectName(string projectName);

        [OperationContract]
        DataTable GetInvoiceData(String filePath);

        [OperationContract]
        int GetSalesQuarter(String filePath);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TracksDataTable GetTracksByProjectID(int projectID);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TracksDataTable GetTracksByProjectIDTrackName(int projectID, string trackName);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TrackSalesDataTable GetTrackSales();

        [OperationContract]
        void InsertProjectName(string projectName);

        [OperationContract]
        void InsertTrackData(int projectID, string trackVersion, string trackName);

        [OperationContract]
        void InsertTrackSales(int trackID, string date, int salesQuarter, int trackSales);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TracksDataTable GetTrackID(int projectID, string trackVersion, string trackName);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ProjectsDataTable GetProjectIDByProjectName(string projectName);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ProjectsDataTable GetAllProjectName();

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.TracksDataTable GetTrackIDbyTrackName(string trackName);

        [OperationContract]
        int GetTotalTrackSales(int trackID);

        [OperationContract]
        int GetTrackSalesByYear(decimal year, int trackID);

        [OperationContract]
        int GetTrackSalesByQuarter(decimal year, int trackID, int salesQuarter);

        [OperationContract]
        int GetArtistID(string artistName);

        [OperationContract]
        DataEntityTier.OpenRecordsDataSet.ProjectsDataTable GetProjectByArtistID(int artistID);
    }

    // Use a data contract as illustrated in the sample below to add composite types to service operations
    [DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }
}
